package com.wms.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;


@Mapper
public interface ChartMapper {
    // 药品库存统计
    @Select("select Dname, Dnumber from drug")
    List<HashMap> chartA();

    // 订单状态统计
    @Select("SELECT status, COUNT(*) as count FROM orders GROUP BY status")
    List<HashMap> chartB();

    // 仓库容量统计
    @Select("SELECT Wname, Wquantity, Wmaxcapacity FROM warehouse")
    List<HashMap> chartC();

    // 用户角色统计
    @Select("SELECT Urole, COUNT(*) as count FROM user GROUP BY Urole")
    List<HashMap> chartD();

    // 药品分类统计
    @Select("SELECT Dcategory, SUM(Dnumber) as total FROM drug GROUP BY Dcategory")
    List<HashMap> chartE();
}